package absolateValue;

/**
 * @Author MDD
 * @Description
 * @Version
 * @Date
 **/
//舍掉小数取整:Math.floor(3.5)=3
//四舍五入取整:Math.rint(3.5)=4
//进位取整:Math.ceil(3.1)=4
//取绝对值：Math.abs(-3.5)=3.5
//取余数：A%B = 余数

public class AbsolateValue {
    public int abs(int num){
        return Math.abs(num);
    }
    public float abs(float num){
        return Math.abs(num);
    }
    public double abs(double num){
        return Math.abs(num);
    }

    public static void main(String[] args) {
        AbsolateValue juedui = new AbsolateValue();
        System.out.print("int 类型的绝对值为："+juedui.abs(-12)+"\n");
        System.out.print("float 类型的绝对值为："+juedui.abs(-12.4f)+"\n");
        System.out.print("double 类型的绝对值为："+juedui.abs(-12.50)+"\n");
    }


}
